package cc.linker.steplink.crm.merchanth5.pojo.userInfo;

import java.util.Calendar;
import java.util.Date;


/**
 * APP用户积分等级定义信息
 * @author Administrator
 *
 */
public class UserIntegralRuleInfoPo extends UserIntegralRuleInfo{
	public String type;			//积分类型
	public String intrgralDb;	//数据库中积分数值
	int intrgralNum=0;			//可得积分；如5
	public int getIntrgralNum() {
		switch (type) {
		case "3":
			Calendar calendar = Calendar.getInstance();      
		    calendar.setTime(new Date());      
		    int w = calendar.get(Calendar.DAY_OF_WEEK)-1;//判断周几
		    if(w==0){//周日
		    	w=7;
		    }
		    String integral=intrgralDb.split(",")[w-1];
		    intrgralNum = Integer.valueOf(integral);
			break;

		default:
			intrgralNum = Integer.valueOf(intrgralDb);
			break;
		}
		return intrgralNum;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getIntrgralDb() {
		return intrgralDb;
	}
	public void setIntrgralDb(String intrgralDb) {
		this.intrgralDb = intrgralDb;
	}
	
}
